#include "stdafx.h"
#ifndef NO_COMPLEX_ENTITIES
#include "wf_parisdebugcreatecontainer.h"

/**
 * Constructor.
 */
WF_PARISDebugCreateContainer::WF_PARISDebugCreateContainer(
    PF_Container& container,
    PF_GraphicView& graphicView)
        : PF_ActionInterface("PF_actionparischeckcont",
                     container, graphicView) {

    //QMessageBox::about(NULL, "info", "check container");
    PF_Document* theDoc = (PF_Document*) &container;

    if (theDoc->countSelected() < 2) {
        return;
	}

    PF_Container* con = new PF_Container(theDoc, true);
    QListIterator<PF_Entity*> it = theDoc->createIterator();
    PF_Entity* e;

    while (it.hasNext()) {
        e = it.next();
        if (e->isSelected()) {
            con->addEntity(e);
            e->setParent(con);
        }
    }

    theDoc -> addEntity(con);
}



WF_PARISDebugCreateContainer::~WF_PARISDebugCreateContainer() {
}

#endif


// EOF
